package com.sumainfor.wx.system.gmio.controller;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.wx.system.gmio.service.HouseSelectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author Meng
 * @ClassName HouseSelectController
 * @date 2019/8/12 14:38
 * @description: TODO
 */
@RestController
@RequestMapping("/houseSelect")
public class HouseSelectController {

    @Autowired
    private HouseSelectService houseSelectService;

    /**
     * @Description //TODO 根据省市区条件查询项目编号列表
     * @return com.sumainfor.common.util.JsonResult
     * @Param [params]
     * @Date 2019/8/12 15:51
     **/
    @GetMapping("SelectCommunityList")
    public JsonResult SelectCommunityList(@RequestParam Map<String, Object> params) {

        return houseSelectService.SelectCommunityList(params);
    }

    /**
     * @Description //TODO 查询所有的省, stemDataType字段为all时, 查询所有的省, 为term时, 查询有项目的省
     * @return com.sumainfor.common.util.JsonResult
     * @Param [params]
     * @Date 2019/8/12 15:21
     **/
    @GetMapping("getProvinceList")
    public JsonResult getProvinceList(@RequestParam Map<String, Object> params) {

        return houseSelectService.getProvinceList(params);
    }

    /**
     * @Description //TODO 查询所有的城市列表
     * @return com.sumainfor.common.util.JsonResult
     * @Param [params]
     * @Date 2019/8/12 15:45
     **/
    @GetMapping("getCityList")
    public JsonResult getCityList(@RequestParam Map<String, Object> params) {

        return houseSelectService.getCityList(params);
    }

    /**
     * @Description //TODO 查询所有的区
     * @return com.sumainfor.common.util.JsonResult
     * @Param [params]
     * @Date 2019/8/12 15:45
     **/
    @GetMapping("getDistrictList")
    public JsonResult getDistrictList(@RequestParam Map<String, Object> params) {

        return houseSelectService.getDistrictList(params);
    }

    /**
     * @Description //TODO 查询所有的街道
     * @return com.sumainfor.common.util.JsonResult
     * @Param [params]
     * @Date 2019/8/12 15:49
     **/
    @GetMapping("getStreetList")
    public JsonResult getStreetList(@RequestParam Map<String, Object> params) {

        return houseSelectService.getStreetList(params);
    }

    /**
     * @Description //TODO 查询项目下的所有楼号
     * @return com.sumainfor.common.util.JsonResult
     * @Param [params]
     * @Date 2019/8/12 15:56
     **/
    @GetMapping("getHousingProBuilDingList")
    public JsonResult getHousingProBuilDingList(@RequestParam Map<String, Object> params) {

        return houseSelectService.getHousingProBuilDingList(params);
    }

    /**
     * @Description //TODO 获取楼号下的所有房源
     * @return com.sumainfor.common.util.JsonResult
     * @Param [params]
     * @Date 2019/8/12 15:59
     **/
    @GetMapping("getHousingProRoomList")
    public JsonResult getHousingProRoomList(@RequestParam Map<String, Object> params) {

        return houseSelectService.getHousingProRoomList(params);
    }

    /**
     * @Description //TODO 获取该房源的所有区域
     * @return com.sumainfor.common.util.JsonResult
     * @Param [params]
     * @Date 2019/8/12 16:04
     **/
    @GetMapping("getHousingConList")
    public JsonResult getHousingConList(@RequestParam Map<String, Object> params) {

        return houseSelectService.getHousingConList(params);
    }
}
